package com.example.mansystem.dto;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Positive;
import java.util.List;

@Data
@NoArgsConstructor
public class RegisterDto {
    @Length(min = 3,max=18)
    @Pattern(regexp = "^[a-z0-9A-Z_-]{5,16}$",message = "用户名格式不正确")
    private String username;
    @Pattern(regexp = "^[\u4e00-\u9fa5]{2,6}$",message = "姓名格式不正确")
    @NotBlank(message = "姓名不为空")
    private String name;
    @NotBlank(message = "性别不为空")
    private String sex;
    private String departmentId;
    @NotBlank(message = "密码不为空")
    @Pattern(regexp = "^[a-z0-9A-Z_-]{5,16}$",message = "密码格式不正确")
    private String password;
}
